<!DOCTYPE html>
<html lang="">

<head>
  <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap.min.css" rel="stylesheet">
  <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0">
  <title>代办</title>
</head>
<body>

  <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <div class="container-fluid">
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
          <li class="nav-item">
            <a class="nav-link {% if active == 'index' %}active{% endif %}" href="{% url 'index' %}">首页</a>
          </li>
          <li class="nav-item">
            <a class="nav-link {% if active == 'login' %}active{% endif %}" href="{% url 'login' %}">登录</a>
          </li>
          <li class="nav-item">
            <a class="nav-link {% if active == 'signup' %}active{% endif %}" href="{% url 'signup' %}">注册</a>
          </li>
          {% if request.user.is_authenticated %}
          <li class="nav-item">
            <a class="nav-link" href=" {% url 'logout' %} ">退出</a>
          </li>
          {% endif %}
        </ul>
        <form class="d-flex">
          <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
          <button class="btn btn-outline-success" type="submit">Search</button>
        </form>
      </div>
    </div>
  </nav>

  {% if messages %}
  <ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</li>
      {% endfor %}
  </ul>
  {% endif %}

  <div class="container">
  {% block content %}
  {% endblock %}
  </div>
</body>

</html>